<?php
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/weebox.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/fanweUI.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/style.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/public.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/color.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/duobao.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/relate_goods.css";
$this->_var['pagecss'][] = $this->_var['TMPL_REAL']."/css/layer.css";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/jquery-1.6.2.min.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/jquery.bgiframe.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/jquery.timer.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/jquery.weebox.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/jquery.touchwipe.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/fastclick.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/utils/TouchSlide.1.1.js";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/fanwe_utils/fanweUI.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/fanwe_utils/fanweUI.js";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/script.js";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/onload.js";
$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/swipe.js";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/duobao.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/duobao.js";


$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/relate_goods.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/relate_goods.js";

$this->_var['pagejs'][] = $this->_var['TMPL_REAL']."/js/layer.m/layer.m.js";
$this->_var['cpagejs'][] = $this->_var['TMPL_REAL']."/js/layer.m/layer.m.js";



?>
{include file="inc/header_title_home.html"}
<script type="text/javascript">
var cart_conf_json = {$cart_conf_json};
var cart_data_json = {$cart_data_json};
var to_cart_url = "{url x="index" r="cart#index"}";
</script>


<div class="wrap page_detail">

<div class="content">
    <!--关于商品-->
    <div class="goods-box goods-abbr">

		<div class="top">
		{if $item_data.unit_price eq 100}<div class="hundredyen"></div>{/if}
        <div class="tenyen"></div>
            <div class="flash" id="containerFlashAnimation">
                <section>
                     	<div id="banner_box" class="banner_box banner_box_half">
						<div class="bd">
							<ul>
								 {foreach from=$item_data.deal_gallery item=img}
		                            <li style="vertical-align: top; width: 100%; display: table-cell;height:8.5rem">
		                                <img src="{$img}" style="height:8.5rem;margin:0 auto;display:block;"/>
		                            </li>
									{/foreach}
							</ul>
						</div>
						<div class="hd"><ul></ul></div>
					</div>
                </section>
            </div>
        </div>

        {if $item_data.duobao_status eq 0}
         <!-- 进行中 -->
        <div class="good-on">
            <em class="on">进行中</em>
            <p>{$item_data.name} <span>{$item_data.brief}</span>

            </p>
            {if $item_data.unit_price eq 100}

            <span style="color:#df5667; display:block; margin-bottom:.2rem;">1人次=100元&nbsp;&nbsp; {if $item_data.user_max_buy gt 0}每人限购 {$item_data.user_max_buy} 次{/if} </span>
            {/if}
            <div class="progress">
                <p>期号：{$item_data.id}</p>
                <progress max="{$item_data.max_buy}" value="{$item_data.current_buy}"></progress>
                <p class="fl">总需<em id="pro-max">{$item_data.max_buy}</em>人次</p>
                <p class="fr">剩余<span id="pro-rest">{$item_data.surplus_count}</span></p>
                <div class="clear"></div>
            </div>
        </div>
         {elseif $item_data.duobao_status eq 1}
        <!-- 倒计时 -->
        <div class="good-countdown">
             <em class="countdown">倒计时</em>
             <p>{$item_data.name} <span>{$item_data.brief}</span>
             </p>
             <div class="countdown-box">
                 <p>期号：{$item_data.id} </p>
                 <p class="fl">揭晓倒计时</p>
                 <time class="fl w-countdown-nums" duobao_item_id="{$item_data.id}" nowtime="{$item_data.now_time}" endtime="{$item_data.lottery_time}"></time>
                 <a href="{url x="index" r="duobao#detail" p="data_id=$item_data.id"}">计算详情</a>
             </div>
        </div>
        {elseif $item_data.duobao_status eq 2}
        <!-- 已揭晓 -->
        <div class="good-announced">
             <em class="announced">已揭晓</em>
             <p>{$item_data.name} <span>{$item_data.brief}</span>
             </p>
             <div class="announced-box">
                <div class="announcer">
                </div>
                 <div class="imgbox" style="background:url({function name="get_user_avatar" uid=$item_data.luck_lottery.user_id type="small"});background-size: contain">

                 </div>
                 <ul>
                     <li>
                         <p>获奖者：</p>
                         <div class="fl">
                             <a href="{url x="index" r="anno_user_center" p="lucky_user_id=$item_data.luck_user_id"}">{$item_data.luck_lottery.user_name}</a>
                             <em>{$item_data.luck_lottery.duobao_ip}({$item_data.luck_lottery.duobao_area})</em>
                         </div>
                         <div class="clear"></div>
                     </li>
                     <li>
                         <p>用户ID：</p>{$item_data.luck_user_id}（唯一不变标识）
                     </li>
                     <li>
                         <p>期 &nbsp;&nbsp;&nbsp;号：</p>
                         {$item_data.id}
                     </li>
                     <li>
                         <p>本期参与：</p>
                         <span>{$item_data.luck_lottery.user_total}</span>人次
                     </li>
                     <li>
                     <p>揭晓时间：</p>
                     {$item_data.lottery_time_format}
                     </li>
                 </ul>
                 <div class="clear"></div>
                 <div class="luckycode">
                     <p class="fl">幸运号码：
                     </p>
                     <em class="fl">{$item_data.lottery_sn}</em>
                     <a href="{url x="index" r="duobao#detail" p="data_id=$item_data.id"}">计算详情</a>
                 </div>
             </div>
        </div>
        <!-- 已揭晓 -->
        {/if}

		{if $data.user_login_status eq 0}
        <div class="login-to-check">
            <p><a href="{url x="index" r="user#login"}">登录</a>以查看你的夺宝号码~</p>
        </div>
        <!-- 未登录 -->
		{else}
		{if !$data.my_duobao_log}
        <div class="notin">
            <p>您没有参与本期夺宝哦！</p>
        </div>
        <!-- 未参与 -->

		{else}
        <div class="joined">
            <p>您参与了：<span>{$data.my_duobao_count}</span>人次</p>
            <dl id="duobao_sn_list">
                <dt>夺宝号码：</dt>
				{foreach from=$data.my_duobao_log item=log}
                <dd>{$log.lottery_sn}</dd>
                {/foreach}
            </dl>
            <a id="func" href="javascript:void(0);" style="float:right; margin-right:.36rem;color:#39f;margin-top:.4rem;font-size: .52rem;">展开<i class="iconfont">&#xe6c3;</i></a>
            <div class="clear"></div>
        </div>
		{/if}
        <!-- 参与信息 -->
		{/if}
    </div>
    <div class="infomation">
        <ul>
            <li><a href="{url x="index" r="duobao#more" p="data_id=$item_data.id"}">图文详情<i class="iconfont">&#xe6fa;</i><span class="fr">建议在wifi下查看</span></a></li>
            <div class="info-border"></div>
            <li><a href="{url x="index" r="duobao#duobao_record" p="data_id=$item_data.duobao_id"}">往期揭晓<i class="iconfont">&#xe6fa;</i></a></li>
            <!--<div class="info-border"></div>
            <li><a href="#">晒单分享<i class="iconfont">&#xe6fa;</i></a></li>-->
        </ul>
    </div>
    <!-- 信息 -->
	{if $data.duobao_order_list}
    <div class="join-data ">
        <div class="all-data split-line">
                     所有参与记录<span class="fr">(<time>{$item_data.create_time_format}</time>开始)</span>
        </div>
        <dl >
            <dt>
            <time>{$item_data.create_time_format}</time>
            </dt>
            <div class="scroll_bottom_list">


			{foreach from=$data.duobao_order_list item=duobao_order}
            <dd>
                <div class="imgbox" style="background:url({function name="get_user_avatar" uid=$duobao_order.user_id type="small"});background-size: contain"></div>
                <div class="txtbox">
                    <!-- <a href="javascript:void(0);">{$duobao_order.user_name}</a> -->
                    <a href="{url x="index" r="anno_user_center" p="lucky_user_id=$duobao_order.user_id"}">{$duobao_order.user_name}</a>
                    <!-- <a href="{url x="index" r="anno_user_center" p="lucky_user_id=$item.luck_user_id"}">{$item.luck_user_name}</a> -->
                    <em>({$duobao_order.duobao_area} IP:{$duobao_order.duobao_ip})</em>
                    <p>参与了<span>{$duobao_order.number}</span>人次 <time>{$duobao_order.f_create_time}</time></p>
                </div>
                <div class="clear"></div>
            </dd>
			{/foreach}
            <!-- 个人参与记录 -->
</div>
        </dl>
		{if $pages}
			<div class="fy scroll_bottom_page">
				{$pages}
			</div>
		{/if}

    </div>
	{/if}

	{if $data.next_id}
    <div class="gotonew">
        <div class="gotonew-box">
        <p>新一期正在火热进行...</p>
        <a href="{url x="index" r="duobao" p="data_id=$data.next_id"}">立即前往</a>
        </div>
    </div>
	{/if}
    <div class="joinin">
        <div class="joinin-box">
                <input type="hidden" name="data_id" value="{$item_data.id}"/>
                <a class="jionin-in joinin-btn" href="javascript:void(0);"  data-type="1">立即参与</a>
        		<a class="jionin-list joinin-btn" href="javascript:void(0);"  data-type="2">加入清单</a>
                <a href="{url r="index" p="cart#index"}" class="iconfont-box">
                <i class="iconfont">&#xe658;</i>
                <div class="goods-in-list">1</div>
                </a>
        </div>
    </div>
</div>

</div>


{if $item_data.duobao_status eq 0}
<div class="am-layer">
    <div class="am-layer-title"><span class="title-txt">人次期数选择</span><div class="cencel-btn iconfont">&#xe608;</div></div>
  <div class="am-layer-con">
      <div class="item-box">
        <div class="item-title">
            参与人次
        </div>
        <div class="item-con">
            <div class="buy-num-box">
                <a class="iconfont reduce-btn count-btn">&#xe6d3;</a>
                <input type="text" value="1" name="buy_num" class="buy-num-input"  />
                <a class="iconfont plus-btn count-btn">&#xe6d1;</a>
            </div>
            <div class="blank5"></div>
            <div class="min-buy-box"><em>参与人次需是{$item_data.min_buy}的倍数</em></div>
        </div>
      </div>
			<div class="item-floot sub-btn-list">
				<div class="sub-btn-1 f-btn-box"><a class="add_cart_item" href="javascript:void(0);" data-type="1">1元夺宝</a></div>
				<div class="sub-btn-2 f-btn-box"><a class="add_cart_item" href="javascript:void(0);" data-type="2" >加入清单</a></div>
			</div>
  </div>
</div>
{/if}
<div class="blank50"></div>
{include file="inc/no_footer.html"}
